//
// Copyright (c) 2009-2011, chunquedong
//
// This file is part of ChunMap project
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
//
// History:
//   2011-09-30  Jed Young  Creation
//

using gfx
using gfx2

using chunmapModel
using chunmapData
using chunmapRaster

**
** image draw point
**
@Js
const class ImagePointSym : GeometrySym
{
  const Image image

  new make(|This| f)
  {
    f(this)
  }

  override Void drawGeometry(Geometry geom, RenderEnv r)
  {
    if (geom isnot GeoPoint) return
    GeoPoint p := geom


    halfW := image.size.w / 2f
    halfH := image.size.h / 2f
    x := r.view.x2Screen(p.x) - halfW
    y := r.view.y2Screen(p.y) - halfH

    g := r.g
    g.drawImage(image, x.toInt, y.toInt)
  }
}